package com.example.texted.mongodb;

//import com.mongodb.MongoClient;
//import com.mongodb.MongoClientOptions;
//import com.mongodb.client.MongoCollection;
//import com.mongodb.client.MongoDatabase;
//import org.bson.Document;

public class MongoUser {

    public static void main(String[] args) {
//连接到 mongodb 服务
//        MongoClient mongoClient = new MongoClient("localhost", 27100);
//        MongoDatabase cl = mongoClient.getDatabase("CL");
//        MongoCollection<Document> userCollection = cl.getCollection("user");
//        Document user = new Document("name","琉璃").append("age",15);
//
//        userCollection.insertOne(user);
    }

}
